﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls.Primitives;
using System.Windows;

namespace FireZone
{
    public class CustomToggleButton : ToggleButton
    {
        public bool IsNotCheckable
        {
            get { return (bool)GetValue(IsNotCheckableProperty); }
            set { SetValue(IsNotCheckableProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IsNotCheckable.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsNotCheckableProperty =
            DependencyProperty.Register("IsNotCheckable", typeof(bool), typeof(CustomToggleButton), new FrameworkPropertyMetadata((object)false));

        protected override void OnToggle()
        {
            if (!IsNotCheckable)
            {
                base.OnToggle();
            }
        }
    }
}
